import request from '@/utils/request';

// 获取专家列表
export function getExpertList() {
  return request({
    url: '/api/experts',
    method: 'get',
  });
}

// 获取专家详情
export function getExpertDetail(userId) {

  const url = '/api/experts/' + userId;
  return request({
    url: url,
    method: 'get',
  });
}

export function updateExpert(expert) {
  return request({
      url: `/api/experts/${expert.userId}`,
    method: 'put',
    data: expert
  });
}

// 通过 userId 获取专家表信息
export function getExpertInfo(userId) {
  return request({
    url: `/expert/info`,
    method: 'get',
    params: { userId }
  });
} 